<?php
/**
 * #Celebrate Shieh
 *             ,%%%%%%%%,
 *           ,%%/\%%%%/\%%
 *          ,%%%\c "" J/%%%
 * %.       %%%%/ o  o \%%%
 * `%%.     %%%%    _  |%%%
 *  `%%     `%%%%(__Y__)%%'
 *  //       ;%%%%`\-/%%%'
 * ((       /  `%%%%%%%'
 *  \\    .'          |
 *   \\  /       \  | |
 *    \\/         ) | |
 *     \         /_ | |__
 *     (___________))))))) 攻城湿
 *
 *        _       _
 * __   _(_)_   _(_) __ _ _ __
 * \ \ / / \ \ / / |/ _` |'_ \
 *  \ V /| |\ V /| | (_| | | | |
 *   \_/ |_| \_/ |_|\__,_|_| |_|
 */

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGalleriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('galleries', function ( Blueprint $table ) {
            $table->increments('id');
            $table->integer('category_id')->default(0)->comment('类型');
            $table->integer('user_id')->default(0)->comment('用户');
            $table->string('title')->nullable()->comment('文章标题');
            $table->string('pic')->nullable()->comment('文章封面图');
            $table->integer('browse')->default(0)->comment('浏览数');
            $table->integer('share')->default(0)->comment('分享');
            $table->integer('like')->default(0)->comment('喜欢');
            $table->integer('step')->default(0)->comment('踩');
            $table->integer('comment')->default(0)->comment('评论数量');
            $table->tinyInteger('root')->default(1)->comment('是否置顶：1：否，2：是');
            $table->tinyInteger('is')->default(1)->comment('是否可以评论：1：是，2：否');
            $table->tinyInteger('status')->default(1)->comment('保存：1：待审核，2：审核成功，3：审核失败');
            $table->longText('fail')->nullable()->comment('审核失败提示');
            $table->longText('intro')->nullable()->comment('格式化内容');
            $table->longText('content')->nullable()->comment('内容');
            $table->longText('markdown')->nullable()->comment('markdown编辑器');
            $table->tinyInteger('is_show')->default(1)->comment('1：显示，2：隐藏');
            $table->tinyInteger('static')->default(1)->comment('1：正常，2：回收站，3：彻底删除');
            $table->timestamp('deleted_at')->nullable()->comment('删除时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('galleries');
    }
}
